package com.yb.livewykt.bean

import com.yb.livewykt.R

class Filter(val name: String, val iconId: Int, val nameId: Int,var isCheck:Boolean) {

    constructor(name: String):this(name, R.drawable.demo_icon_cancel, R.string.origin,false)

    companion object{
        fun create(name: String):Filter = Filter(name)

    }

    override fun equals(o: Any?): Boolean {
        if (this === o) {
            return true
        }
        if (o == null || javaClass != o.javaClass) {
            return false
        }
        val filter: Filter = o as Filter
        return name == filter.name
    }

    override fun hashCode(): Int {
        return name?.hashCode() ?: 0
    }

    override fun toString(): String {
        return "Filter{" +
                "name='" + name + '\'' +
                ", iconId=" + iconId +
                ", nameId=" + nameId +
                '}'
    }
}